<html lang="en" xmlns:th="http://www.thymeleaf.org">
<div th:replace="themes/default/header::header(null,${keywords})"></div>
<link rel="stylesheet" th:href="@{/user/bootstrap/css/bootstrap.min.css}">
<script th:src="@{/user/editormd/lib/marked.min.js}"></script>
<script th:src="@{/user/editormd/lib/prettify.min.js}"></script>
<script th:src="@{/user/editormd/lib/raphael.min.js}"></script>
<script th:src="@{/user/editormd/lib/underscore.min.js}"></script>
<script th:src="@{/user/editormd/lib/sequence-diagram.min.js}"></script>
<script th:src="@{/user/editormd/lib/flowchart.min.js}"></script>
<script th:src="@{/user/editormd/lib/jquery.flowchart.min.js}"></script>
<script th:src="@{/user/editormd/editormd.js}"></script>
<body style="background: #f2f2f2;">
<div class="main-content index-page clearfix">
    <div class="row">
        <div class="col-md-9 blog-main">
            <div class="my-3 p-3 bg-white rounded shadow-sm">
                <h6 class="border-bottom border-gray pb-2 mb-0">
                    Q&A 累计：
                    <span th:text="${pageParam.getTotal()}"></span>
                    <span class="float-right" th:if="${!#strings.isEmpty(thisCategoryName)}">
                        <a th:href="@{/question}">全部</a>
                        /
                        <span th:text="${thisCategoryName}"></span>
                    </span>
                </h6>

                <div th:each="question:${questionList}" class="media text-muted pt-3">
                    <!-- 头像 -->
                    <img th:src="${question.getAuthorAvatar()}" style="border-radius: 5px " width="32" height="32">
                    <p class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray" style="margin-left: 5px">
                        <!-- 标题 -->
                        <a th:text="${question.getTitle()}"
                           th:href="@{'/question/read/'+${question.getQid()}}"
                           class="text-dark font-weight-bold text-decoration-none d-block">
                        </a>
                        <!-- 状态 -->
                        <span th:text="${question.getStatus()==0?'未解决':'已解决'}"
                              th:class="${question.getStatus()==0?'badge badge-warning':'badge badge-info'}">
                        </span>
                        <!-- 浏览量 -->
                        <span>
                            <svg class="bi bi-eye-fill" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor"
                                 xmlns="http://www.w3.org/2000/svg">
  <path d="M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z"/>
  <path fill-rule="evenodd"
        d="M0 8s3-5.5 8-5.5S16 8 16 8s-3 5.5-8 5.5S0 8 0 8zm8 3.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"/>
</svg>
                            [[${question.getViews()}]]
                        </span>
                        <!-- 时间 -->
                        <span th:text="${#dates.format(question.getGmtUpdate(),'yyyy年MM月dd日 HH:mm')}"
                              class="badge badge-light float-right">
                        </span>
                    </p>
                </div>

                <!--分页-->
                <div style="clear: both;"></div>
                <div class="lists-navigator clearfix">
                    <div th:replace="comm/macros::pageNav(${pageParam},'←','→','page')"></div>
                </div>

            </div>

        </div>

        <aside class="col-md-3 blog-sidebar">

            <div class="my-3 rounded">
                <p class="mb-0">
                    <a id="publish" class="btn btn-primary btn-sm btn-block"
                       style="color: white">发布问题</a>
                </p>
            </div>

            <div class="p-4 my-3 bg-white rounded">
                <p class="mb-0"> 社区公约: <br> 禁止发布广告、违法信息，如有发现，直接封号！</p>
            </div>

            <div class="p-4 my-3 bg-white rounded">
                <a th:href="@{'/question/category/'+${category.getId()}+'/1/10'}"
                   th:each="category:${categoryList}" th:text="${category.getCategory()}"
                   class="badge badge-pill badge-primary mr-1"></a>
            </div>

        </aside>

    </div>

</div>
</body>
<script>
    //th:href="@{/question/write}"
    $("#publish").click(function () {
        window.location.href = '/question/write';
    })
</script>
<div th:replace="themes/default/footer::footer"></div>
<div th:replace="comm/connect::connect"></div>
<link th:href="@{/user/css/fixcss.css}" rel="stylesheet"/>
</html>